import request from '@/utils/request_1'

// 新增入库单
export const addWarehouseIn = (params: any) =>
  request({
    url: '/receipt',
    method: 'post',
    data: { ...params }
  })

// 修改入库单
export const updateWarehouseIn = (params: any) =>
  request({
    url: '/receipt',
    method: 'put',
    data: { ...params }
  })

// 删除入库单
export const deleteWarehouseIn = (params: any) =>
  request({
    url: '/receipt',
    method: 'delete',
    params
  })

// 取消入库单
export const cancleWarehouseIn = (params: any) =>
  request({
    url: '/receipt/cancel',
    method: 'put',
    data: { ...params }
  })

// 查询详情
export const findWarehouseInDetail = (id: string) =>
  request({
    url: `/receipt/detail/${id}`,
    method: 'get'
  })

// 查询全部入库单
export const findAllWarehouseIn = (params: any) =>
  request({
    url: '/receipt/list',
    method: 'get',
    params
  })

// 分页查询入库单
export const findWarehouseInPaging = (params: any) =>
  request({
    url: '/receipt/page',
    method: 'get',
    params
  })

// 分页查询入库单明细
export const findWarehouseInDetailPaging = (params: any) =>
  request({
    url: '/receipt/pageDetail',
    method: 'get',
    params
  })

// 生成收货任务
export const createReceiveGoodsTask = (params: any) =>
  request({
    url: '/receipt/receiving',
    method: 'post',
    data: params
  })

// 查询入库单
export const findWarehouseIn = (id: any) =>
  request({
    url: `/receipt/${id}`,
    method: 'get'
  })
